import request from '@/utils/request'

// 创建轮播图
export function createCarousel(data) {
  return request({
    url: '/carousel',
    method: 'post',
    data
  })
}

// 更新轮播图
export function updateCarousel(data) {
  return request({
    url: '/carousel',
    method: 'put',
    data
  })
}

// 删除轮播图
export function deleteCarousel(id) {
  return request({
    url: `/carousel/${id}`,
    method: 'delete'
  })
}

// 获取轮播图详情
export function getCarouselDetail(id) {
  return request({
    url: `/carousel/${id}`,
    method: 'get'
  })
}

// 分页查询轮播图
export function pageCarousels(params) {
  return request({
    url: '/carousel/page',
    method: 'get',
    params
  })
}

// 获取所有启用的轮播图
export function listEnabledCarousels() {
  return request({
    url: '/carousel/enabled',
    method: 'get'
  })
}

// 设置轮播图状态（启用/禁用）
export function setCarouselStatus(id, status) {
  return request({
    url: '/carousel/status',
    method: 'put',
    data: {
      id,
      status
    }
  })
} 